create table customer(
	id number(8) primary key,
	cname varchar2(20),
	salary number(6,2),
	birth_date date,
	sex char(1))
	
	insert into customer(id,cname,salary) values(seq_c1.nextval,'Mike',333.4)
	
create table hobby(
	id number(8) primary key,
	hname varchar2(24)
)
--- --------
  4 travel
  5 chat
  6 running
  7 swimming
  2 football
  3 film

create table cus_hobby(
	id number(8) primary key,
	c_id number(8) not null,
	h_id number(8) not null
)
alter table cus_hobby add constraint FK_CUS_CID foreign key (c_id) references customer(id);
alter table cus_hobby add constraint FK_CUS_HID foreign key (h_id) references hobby(id);
	
create sequence seq_c1 start with 1 increment by 1;
create sequence seq_c2 start with 1 increment by 1;
create sequence seq_c3 start with 1 increment by 1;

insert into hobby(id,hname) values(seq_c2.nextval,'football')
insert into hobby(id,hname) values(seq_c2.nextval,'film')
insert into hobby(id,hname) values(seq_c2.nextval,'travel');
insert into hobby(id,hname) values(seq_c2.nextval,'chat');
insert into hobby(id,hname) values(seq_c2.nextval,'running');
insert into hobby(id,hname) values(seq_c2.nextval,'swimming');


select ch.c_id,h.hname from cus_hobby ch,hobby h where ch.h_id=h.id and c_id=6;

